package com.shop.cereshop.commons.tencent.im.model.msg.data;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author zdd
 * @version 1.0
 * @description: 自定义消息数据基类
 * @date 2025/9/23 12:19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CustomMsgDataModel<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 版本
     */
    private String version;

    /**
     * 自定义消息类型（如：rep_packet、transfer等）
     */
    private String type;

    /**
     * 消息数据体
     */
    private T data;

    /**
     * 时间戳
     */
    private long timestamp;

    public CustomMsgDataModel(String type, T data) {
        this.type = type;
        this.data = data;
        this.timestamp = System.currentTimeMillis();
        this.version = "1.0";
    }

}
